package service

import (
	"e_mall_server/dao/mysql"
	"e_mall_server/models"
)

/**
 * @Author: zhaobin
 * @Description TODO
 * @Date: 2022-05-07 18:26
 */

// GetCarouselList 获取轮播图列表接口
func GetCarouselList(query map[string]interface{}) ([]models.Carousel, error) {
	return mysql.GetCarouselList(query)
}

// AddCarousel 添加轮播图信息
func AddCarousel(carousel *models.Carousel) error {
	return mysql.AddCarousel(carousel)
}

// UpdateCarousel 修改轮播图信息
func UpdateCarousel(carousel *models.Carousel) int64 {
	return mysql.UpdateCarousel(carousel)
}

// DeleteCarouselById 通过轮播图id删除轮播图数据
func DeleteCarouselById(id int64) int64 {
	return mysql.DeleteCarouselById(id)
}

// GetCarouselDetailById 通过轮播图id获取轮播图详细信息
func GetCarouselDetailById(id int64) (models.Carousel, error) {
	return mysql.GetCarouselDetailById(id)
}
